<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('safes', function (Blueprint $table) {
            $table->id();
            $table->string('title')->index();
            $table->unsignedBigInteger('project_id')->index()->comment('所属项目ID');
            $table->unsignedBigInteger('type_id')->index()->comment('类型');
            $table->unsignedBigInteger('plan_id')->index()->default(0)->comment('平面图');
            $table->unsignedBigInteger('person_id')->default(0)->comment('责任人');
            $table->string('floor')->nullable()->comment('楼层');
            $table->date('next_check_date')->nullable()->comment('开始日期');
            $table->date('check_date')->nullable()->comment('结束日期');
            $table->string('delaies')->nullable()->comment('延期天数');
            $table->tinyInteger('status')->index()->default(1)->comment('是否上报 0否 1是');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('safes');
    }
};
